type ColorValue = {
  '--fxl-primary-color': string
  '--fxl-button-background': string
  '--fxl-button-text': string
  '--fxl-rightsdetail-price-background': string
  '--fxl-rightsdetail-price-logo': string
  '--fxl-rightsdetail-price-color': string
  '--fxl-rightsdetail-market-price-color': string
  '--fxl-rightsdetail-pay-active-icon': string
  '--fxl-orderlist-button-border-color': string
  '--fxl-orderlist-button-text-color': string
  '--fxl-orderdetail-exchange-popup-background': string
  // '--fxl-rights-detail-background': string
}

export const setCssVariable = (cssVariable: ColorValue) => {
  let key: keyof ColorValue
  for (key in cssVariable) {
    if (Object.prototype.hasOwnProperty.call(cssVariable, key)) {
      document.documentElement.style.setProperty(key, cssVariable[key])
    }
  }
}
